package org.example.controller;


import lombok.extern.slf4j.Slf4j;
import org.example.pojo.OperateLog;
import org.example.pojo.PageResult;
import org.example.pojo.Result;
import org.example.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class OperateLogController {

    @Autowired
    private OperateLogService logService;

    @GetMapping("/log/page")
    public Result page(@RequestParam  Integer page,
                       @RequestParam Integer pageSize) {
        log.info("分页查询，参数：{},{}", page, pageSize);
        PageResult<OperateLog> pageResult = logService.page(page, pageSize);
        return Result.success(pageResult);
    }
}
